/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.app.model.entities;

import java.io.Serializable;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Santiago
 */
@Entity
@Table(name = "jmb_post_answers")
@XmlRootElement
@NamedQueries({
  @NamedQuery(name = "JmbPostAnswers.findAll", query = "SELECT j FROM JmbPostAnswers j"),
  @NamedQuery(name = "JmbPostAnswers.findByAnswerId", query = "SELECT j FROM JmbPostAnswers j WHERE j.answerId = :answerId"),
  @NamedQuery(name = "JmbPostAnswers.findByAnswerContent", query = "SELECT j FROM JmbPostAnswers j WHERE j.answerContent = :answerContent"),
  @NamedQuery(name = "JmbPostAnswers.findByAnswerBeans", query = "SELECT j FROM JmbPostAnswers j WHERE j.answerBeans = :answerBeans"),
  @NamedQuery(name = "JmbPostAnswers.findByAnswerIdPost", query = "SELECT j FROM JmbPostAnswers j WHERE j.answerIdPost = :answerIdPost")})
public class JmbPostAnswers implements Serializable {
  private static final long serialVersionUID = 1L;
  @Id
  @Basic(optional = false)
  @NotNull
  @Column(name = "answer_id")
  private Integer answerId;
  @Size(max = 2147483647)
  @Column(name = "answer_content")
  private String answerContent;
  @Basic(optional = false)
  @NotNull
  @Column(name = "answer_beans")
  private int answerBeans;
  @Column(name = "answer_id_post")
  private Integer answerIdPost;

  public JmbPostAnswers() {
  }

  public JmbPostAnswers(Integer answerId) {
    this.answerId = answerId;
  }

  public JmbPostAnswers(Integer answerId, int answerBeans) {
    this.answerId = answerId;
    this.answerBeans = answerBeans;
  }

  public Integer getAnswerId() {
    return answerId;
  }

  public void setAnswerId(Integer answerId) {
    this.answerId = answerId;
  }

  public String getAnswerContent() {
    return answerContent;
  }

  public void setAnswerContent(String answerContent) {
    this.answerContent = answerContent;
  }

  public int getAnswerBeans() {
    return answerBeans;
  }

  public void setAnswerBeans(int answerBeans) {
    this.answerBeans = answerBeans;
  }

  public Integer getAnswerIdPost() {
    return answerIdPost;
  }

  public void setAnswerIdPost(Integer answerIdPost) {
    this.answerIdPost = answerIdPost;
  }

  @Override
  public int hashCode() {
    int hash = 0;
    hash += (answerId != null ? answerId.hashCode() : 0);
    return hash;
  }

  @Override
  public boolean equals(Object object) {
    // TODO: Warning - this method won't work in the case the id fields are not set
    if (!(object instanceof JmbPostAnswers)) {
      return false;
    }
    JmbPostAnswers other = (JmbPostAnswers) object;
    if ((this.answerId == null && other.answerId != null) || (this.answerId != null && !this.answerId.equals(other.answerId))) {
      return false;
    }
    return true;
  }

  @Override
  public String toString() {
    return "org.app.model.entities.JmbPostAnswers[ answerId=" + answerId + " ]";
  }
  
}
